 <%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
	String basePath=request.getContextPath();
%>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>CUSP 客户统一服务平台</title>
		<link href="../../../style/layout.css" rel="stylesheet" type="text/css" />
		<link href="../../../style/mian.css" rel="stylesheet" type="text/css" />
	</head>

<script language="javascript">

	function RefreshMain(url){

	  document.getElementById("title").src=url;

	}
	function showloginmenus(){

		document.getElementById('title').src='/cusp/manager/frame/title.jsp';
		document.getElementById('menu').src='/cusp/jsp/page/head.jsp';
		document.getElementById('left').src='/cusp/manager/frame/mainLeft.jsp';
		document.getElementById('mian').src='/cusp/manager/frame/welcome.jsp';
	}

	var xmlHttp;

	function createXMLHttpRequest()
	{
	    if (window.ActiveXObject) {
	        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	    }
	    else if (window.XMLHttpRequest) {
	        xmlHttp = new XMLHttpRequest();
	    }
	}

	function startRequest() {
	    createXMLHttpRequest();
	    xmlHttp.onreadystatechange = handleStateChange;
	    xmlHttp.open("GET", "bulletin/searchmarquee.action", true);
	    xmlHttp.send(null);
	}

	function handleStateChange() {
	    if(xmlHttp.readyState == 4) {
	        if(xmlHttp.status == 200) {
	        	var value=xmlHttp.responseText;
<%--	        	alert("The server replied with: "+value);--%>
	        	var str=value.split(",");
	        	var add="";
				for(var i=0;i<str.length-1;i++){
					var para=str[i].split("/");
						a=para[0];
						b=para[1];
						c=para[2];
					var x=i+1;
						if(x%2==1){
							add+="<a href='javascript:myopenWindows(\"/bulletin/view.action?bulletinId="+a+"\",\"查看公告信息\",\"bulletinview"+a+"\");search();'>"+
							"<font color='red'>["+b+"]:</font><font color='yellow'>"+c+"</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+"</a>";
						}
						if(x%2==0){
							add+="<a href='javascript:myopenWindows(\"/bulletin/view.action?bulletinId="+a+"\",\"查看公告信息\",\"bulletinview"+a+"\");search();'>"+
							"<font color='red'>["+b+"]:</font><font color='white'>"+c+"</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+"</a>";
						}
				}
				document.getElementById('bulletin').innerHTML=add;
	        }
	    }
	}

	function search(){
<%--		timer=window.setTimeout(search,50000);--%>
		startRequest();

	}

	function myopenWindows(url,name,id){
	  try{
		window.top.frames['left'].openWindows(url,name,id);
	  }catch(er){
	    alert(er.name+":"+er.message);
	  }
	}
	imgstatus=true;
	function resizewin(){
	  try{
		var img=document.getElementById("resizeImg");
		var mtd=document.getElementById("menutd");
		if(imgstatus){
			img.src="../../frame/images/toright.jpg";
			mtd.style.width="1px";
		}
		else{
			img.src="../../frame/images/toleft.jpg";
			mtd.style.width="200px";
		}
		imgstatus=!imgstatus;
	  }
	  catch(ex){
		  alert(ex.name+":"+ex.message);
	  }
	}

</script>
	<body onLoad="search();">
		<div class="layout">
		  <table width=100% height=100% border="0" cellspacing="0" cellpadding="0">
				<tr height="50">
					<td colspan="2" valign="top">
						<iframe name="menu" src="" frameborder=0 id="menu"
							style="width: 100%; height:50px;" scrolling="no"></iframe>
					</td>
			  </tr>
				<tr>
					<td id="menutd" width="200" valign="top"  height="100%">
					  <iframe src="" name="left" scrolling="no" id="left" width="100%" height="100%" frameborder=0></iframe>
					</td>
					<td align="center" valign="top">
						<table width="100%"  height="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td width="5"  style="background-color: #D4D4D4">&nbsp;</td>
								<td height="27" style="border-bottom:#a41d40 1px solid;"><iframe src="" width="100%" height="27"
								id="title" frameborder="0" name="title" scrolling="no" align="left"></iframe></td>

							</tr>
							<tr>
								<td width="10" valign="middle" style="background-color: #D4D4D4"><img id="resizeImg" src="../../frame/images/toleft.jpg" style="cursor:hand" onClick="resizewin()"></td>
								<td valign="top" height="100%">
								<iframe src="" width="100%" height="100%"
									id="mian" frameborder="0" name="mian" scrolling="no" align="left"></iframe>
								</td>

							</tr>
						</table>
					</td>
				</tr>

				<tr>
				  <td colspan="2" style="border-top:#a41d40 2px solid;">
					<table width="100%" id="mytable" border="0" cellspacing="0" cellpadding="0">
					  <tr>
					    <td width=100% style="background:#d4d4d4; color:#600">
						   <marquee id="bulletin" direction="left" scrollamount="3" class="marquee" onmouseover=stop() onmouseout=start()>欢迎光临</marquee>
					    </td>
					  </tr>
					</table>
				  </td>
				</tr>
			</table>
		</div>
		<s:if test="errorCode.length()>0">
<script type="text/javascript">
	alert('<s:property value="errorCode"/>');
</script>
</s:if>

	 <script language="JavaScript">showloginmenus();</script>
</body></html>

